import requests

requests.packages.urllib3.disable_warnings()  # 取消警告

url = "http://httpbin.org/get"
data = {"name1": "哈维迪", "post": "哈弗"}  # form表单数据 post 提交
headers = {"headers": "jfaiojfkaj"}
params = {"name": "花非花"}  # 参数
cookies = {"sessionsid": "ahwfawlfhq"}
json="{'copy':'that'}"
proxies={"http":"http://172.16.210.240.3838"}# 代理
res = requests.get(url, params=params,headers=headers,
                   cookies=cookies,json=json )  # timeout设置超时时间 allow_directs允许重定向 遇到ssl验证用verify=False
print(res.text)  # 字符串的形式
print('-'*100)
url1="http://httpbin.org/post"
res1=requests.post(url1,data=data,json=json)
print(res1.text)
